#27 Test the TagSigner more thoroughly
Merged by abompard. Opened by nphilipp.
nphilipp/robosignatory master--more-tests  into  master

Download 27.patch

In the course, migrate from nose to pytest (because nose upstream is pretty much dead and robosignatory doesn't have much nose-specific code, and because of the features), and some small fixes.

To put this into perspective, I'm about to implement signing Koji side-tag builds in Robosignatory (see issue #28), and I wanted a reasonable test coverage so that I don't screw up things too badly. :wink:

Thanks very much for this!

6 new commits added

  • Test most of the TagSigner functionality
  • Migrate to pytest
  • Fix typo
  • Remove unused variable
  • Add missing % to interpolate exception message
  • Use Pythonic ways to iterate over dicts

The latest push also tests modular builds/tags.

Currently, tox runs python setup.py test and it does not look like this actually runs pytest. I get entirely different outputs when I run .tox/py37/bin/python setup.py test and .tox/py37/bin/python -m pytest.

I recommend this change:

--- a/tox.ini
+++ b/tox.ini
@@ -4,5 +4,8 @@ envlist = py27,py37,py38
 skip_missing_interpreters = True
 [testenv]
+deps =
+    pytest
+    mock
 commands =
-    python setup.py test
+    python -m pytest -v

Thanks for the spotting this, I'll add your config snippet to the PR.

2 new commits added

  • Integrate pytest with setuptools
  • Use pytest when testing with tox

Yep, LGTM, thanks!

For the record, I'm personnaly not a big fan of using the setuptools "test" command, I think it's a failed attempt at unifying testing on Python, and tox is much better at that. Anyway :-)

Pull-Request has been merged by abompard

That was just to be on the safe side, i.e. if people run python setup.py test, they get all the tests, and not just -- silently -- a subset that's based off the legacy unittest.TestCase.

Metadata