Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make unittest optional for python3.5+ #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs-requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
unittest2
unittest2;python_version<'3.5'
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ codecov>=2.0
coverage>=4.3
flake8>=3.2
packaging>=16.8
unittest2>=1.1
unittest2>=1.1;python_version<'3.5'
7 changes: 6 additions & 1 deletion tests/test_deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@

# As we unfortunately support Python 2.7, it lacks TestCase.subTest which
# is in 3.4+ or in unittest2
import unittest2
try:
import unittest2
except ImportError:
import unittest

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could write this more concisely as import unittest as unittest2.

unittest2 = unittest

import warnings

import deprecation
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ commands = coverage run -m unittest discover

[testenv:docs]
deps = Sphinx
unittest2
unittest2;python_version<'3.5'
changedir = docs
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . _build/html