Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_readergroups: allow --iterations=10
The readergroup is global so each test must restore the previous state (empty reader group). The error was: $ pytest --iterations=10 test/test_readergroups.py ============================= test session starts ============================== platform darwin -- Python 3.12.8, pytest-8.3.3, pluggy-1.5.0 rootdir: /Users/rousseau/Documents/sc/pyscard/pyscard configfile: pyproject.toml plugins: run-parallel-0.3.0 collected 7 items test/test_readergroups.py .Fxx..F [100%] =================================== FAILURES =================================== _______________________ test_reader_groups_method_calls ________________________ def test_reader_groups_method_calls(): reader_group = smartcard.reader.ReaderGroups.readergroups() > assert len(reader_group.instance) == 0, "No reader groups should be pre-defined" E AssertionError: No reader groups should be pre-defined E assert 1 == 0 E + where 1 = len(['a']) E + where ['a'] = <smartcard.reader.ReaderGroups.readergroups object at 0x10ecbb110>.instance test/test_readergroups.py:17: AssertionError ____________________ test_demonstrate_getting_is_impossible ____________________ def test_demonstrate_getting_is_impossible(): """Demonstrate that `.getreadergroups()` returns hard-coded values.""" reader_group = smartcard.reader.ReaderGroups.readergroups() list.append(reader_group.instance, "a") > assert reader_group.instance == ["a"] E AssertionError: assert ['a', 'a'] == ['a'] E E Left contains one more item: 'a' E Use -v to get more diff test/test_readergroups.py:88: AssertionError =========================== short test summary info ============================ FAILED test/test_readergroups.py::test_reader_groups_method_calls - AssertionError: No reader groups should be pre-defined FAILED test/test_readergroups.py::test_demonstrate_getting_is_impossible - AssertionError: assert ['a', 'a'] == ['a']
- Loading branch information