mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 16:22:18 -04:00
Now that we're using pytest more aggressively, I think we should start transitioning our tests to that style rather than continuing to use unittest. This PR removes some unnecessary uses of unittest I found. I kept the test classes (while removing the inheritance from unittest.TestCase) where I felt like it added structure or logical grouping of tests. I verified that pytest still finds all the tests in both this branch and master by running commands like: ``` pytest $(git diff --name-only master | grep -v windows_installer_integration_tests) ```
16 lines
396 B
Python
16 lines
396 B
Python
"""Tests for acme.util."""
|
|
import sys
|
|
import unittest
|
|
|
|
import pytest
|
|
|
|
|
|
def test_it():
|
|
from acme.util import map_keys
|
|
assert {'a': 'b', 'c': 'd'} == \
|
|
map_keys({'a': 'b', 'c': 'd'}, lambda key: key)
|
|
assert {2: 2, 4: 4} == map_keys({1: 2, 3: 4}, lambda x: x + 1)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(pytest.main(sys.argv[1:] + [__file__])) # pragma: no cover
|