Commits

Chris Jerdonek committed 6400317

Expose the actual randomseed value in the config instance.

  • Participants
  • Parent commits 0e65c30

Comments (0)

Files changed (2)

tests/test_config.py

     def test_randomseed(self, newconfig):
         config = newconfig([], "")
         assert config.option.randomseed is None
+        seed = config.randomseed
+        assert type(seed) is int
+        assert seed > 0
         config = newconfig(["--randomseed", "100"], "")
         assert config.option.randomseed == 100
+        assert config.randomseed == 100
 
     def test_substitution_jenkins_default(self, tmpdir,
                                           monkeypatch, newconfig):
         if randomseed is None:
             randomseed = makeseed()
         reader.addsubstitions(randomseed=randomseed)
+        # Save the final value if we need it for later, while still preserving
+        # the value provided by the user.
+        config.randomseed = randomseed
 
         reader.addsubstitions(toxinidir=config.toxinidir,
                               homedir=config.homedir)