Skip to content

Commit

Permalink
On Windows c.Skip() before SetUpSuite() causes panics.
Browse files Browse the repository at this point in the history
Bonus points for the fact it doesn't panic the *current* test, it causes the
*next* test to panic.  While there is probably some source issue in
IsolationSuite, not poking the bear is an easy fix.
  • Loading branch information
jameinel committed Feb 2, 2017
1 parent ec0470a commit 0d28067
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion network/bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ for arg in sys.argv[1:]: print(arg)
`

func (s *BridgeSuite) SetUpSuite(c *gc.C) {
s.IsolationSuite.SetUpSuite(c)
if runtime.GOOS == "windows" {
c.Skip("skipping BridgeSuite tests on windows")
}
s.IsolationSuite.SetUpSuite(c)
}

func assertCmdResult(c *gc.C, cmd, expected string) {
Expand Down
3 changes: 2 additions & 1 deletion network/bridgescript_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ type bridgeConfigSuite struct {
var _ = gc.Suite(&bridgeConfigSuite{})

func (s *bridgeConfigSuite) SetUpSuite(c *gc.C) {
s.BaseSuite.SetUpSuite(c)
if runtime.GOOS == "windows" {
c.Skip("Skipping bridge config tests on windows")
}
s.BaseSuite.SetUpSuite(c)

for _, version := range []string{
"/usr/bin/python2",
Expand All @@ -48,6 +48,7 @@ func (s *bridgeConfigSuite) SetUpSuite(c *gc.C) {
}

func (s *bridgeConfigSuite) SetUpTest(c *gc.C) {
s.BaseSuite.SetUpTest(c)
// We need at least one Python package installed.
c.Assert(s.pythonVersions, gc.Not(gc.HasLen), 0)

Expand Down

0 comments on commit 0d28067

Please sign in to comment.