Skip to content

Commit b3bcf60

Browse files
committed
Merge branch 'release/4.29.1' into master
2 parents 6b57ce9 + ed0b93b commit b3bcf60

24 files changed

+38
-40
lines changed

.github/workflows/publishing.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
tests:
1111
name: Run tests
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-18.04
1313
steps:
1414
- uses: actions/checkout@v2
1515
- uses: actions/setup-python@v2
@@ -22,7 +22,7 @@ jobs:
2222

2323
linters:
2424
name: Run linters
25-
runs-on: ubuntu-latest
25+
runs-on: ubuntu-18.04
2626
strategy:
2727
matrix:
2828
toxenv: [flake8, pydocstyle, mypy, pylint]
@@ -39,7 +39,7 @@ jobs:
3939
build-sdist:
4040
name: Build source tarball
4141
needs: [tests, linters]
42-
runs-on: ubuntu-latest
42+
runs-on: ubuntu-18.04
4343
steps:
4444
- uses: actions/checkout@v2
4545
- uses: actions/setup-python@v2
@@ -56,7 +56,7 @@ jobs:
5656
runs-on: ${{ matrix.os }}
5757
strategy:
5858
matrix:
59-
os: [ubuntu-latest, windows-latest, macos-latest]
59+
os: [ubuntu-18.04, windows-latest, macos-latest]
6060
steps:
6161
- uses: actions/checkout@v2
6262
- uses: actions/setup-python@v2
@@ -75,7 +75,7 @@ jobs:
7575
build-wheels-linux-aarch64:
7676
name: Build wheels (ubuntu-latest-aarch64)
7777
needs: [tests, linters]
78-
runs-on: ubuntu-latest
78+
runs-on: ubuntu-18.04
7979
steps:
8080
- uses: actions/checkout@v2
8181
- name: Set up QEMU
@@ -92,7 +92,7 @@ jobs:
9292
publish:
9393
name: Publish on PyPI
9494
needs: [build-sdist, build-wheels, build-wheels-linux-aarch64]
95-
runs-on: ubuntu-latest
95+
runs-on: ubuntu-18.04
9696
steps:
9797
- uses: actions/download-artifact@v2
9898
with:
@@ -106,7 +106,7 @@ jobs:
106106
publish-docs:
107107
name: Publish docs
108108
needs: [publish]
109-
runs-on: ubuntu-latest
109+
runs-on: ubuntu-18.04
110110
steps:
111111
- uses: actions/checkout@v2
112112
- uses: actions/setup-python@v2

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ uninstall:
4848
test-py2: build
4949
# Unit tests with coverage report
5050
coverage erase
51-
coverage run --rcfile=./.coveragerc -m unittest2 discover -s tests/unit/ -p test_*_py2_py3.py
51+
coverage run --rcfile=./.coveragerc -m unittest discover -s tests/unit/ -p test_*_py2_py3.py
5252
coverage report --rcfile=./.coveragerc
5353
coverage html --rcfile=./.coveragerc
5454

5555
test: build
5656
# Unit tests with coverage report
5757
coverage erase
58-
coverage run --rcfile=./.coveragerc -m unittest2 discover -s tests/unit/ -p test_*py3*.py
58+
coverage run --rcfile=./.coveragerc -m unittest discover -s tests/unit/ -p test_*py3*.py
5959
coverage report --rcfile=./.coveragerc
6060
coverage html --rcfile=./.coveragerc
6161

docs/main/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ follows `Semantic versioning`_
1414
Thanks to `@GitterRemote <https://github.com/GitterRemote>`_ for reporting the issue.
1515
- Add docs and example for ``Factory.add_attributes()`` method.
1616
- Remove legacy css file.
17+
- Remove ``unittest2`` test dependency.
1718

1819
4.29.0
1920
------

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
cython==0.29.21
22
tox
3-
unittest2
43
coverage
54
flake8
65
pydocstyle

tests/unit/containers/test_declarative_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Dependency injector declarative container unit tests."""
22

33
import collections
4-
import unittest2 as unittest
4+
import unittest
55

66
from dependency_injector import (
77
containers,

tests/unit/containers/test_dynamic_async_resources_py36.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Dependency injector dynamic container unit tests for async resources."""
22

3-
import unittest2 as unittest
3+
import unittest
44

55
# Runtime import to get asyncutils module
66
import os

tests/unit/containers/test_dynamic_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Dependency injector dynamic container unit tests."""
22

3-
import unittest2 as unittest
3+
import unittest
44

55
from dependency_injector import (
66
containers,

tests/unit/ext/test_flask_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Dependency injector Flask extension unit tests."""
22

3-
import unittest2 as unittest
3+
import unittest
44
from flask import Flask, url_for
55
from flask.views import MethodView
66

tests/unit/providers/test_base_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Dependency injector base providers unit tests."""
22

3-
import unittest2 as unittest
3+
import unittest
44

55
from dependency_injector import (
66
containers,

tests/unit/providers/test_callables_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import sys
44

5-
import unittest2 as unittest
5+
import unittest
66

77
from dependency_injector import (
88
providers,

tests/unit/providers/test_configuration_py2_py3.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
import tempfile
88

9-
import unittest2 as unittest
9+
import unittest
1010

1111
from dependency_injector import containers, providers, errors
1212
try:
@@ -106,6 +106,7 @@ def test_as_(self):
106106

107107
self.assertEqual(value, decimal.Decimal('123.123'))
108108

109+
@unittest.skipIf(sys.version_info[:2] == (2, 7), 'Python 2.7 does not support this assert')
109110
def test_required(self):
110111
provider = providers.Callable(
111112
lambda value: value,
@@ -218,11 +219,13 @@ def test_providers_with_default_value_overriding(self):
218219
def test_value_of_undefined_option(self):
219220
self.assertIsNone(self.config.a())
220221

222+
@unittest.skipIf(sys.version_info[:2] == (2, 7), 'Python 2.7 does not support this assert')
221223
def test_value_of_undefined_option_in_strict_mode(self):
222224
self.config = providers.Configuration(strict=True)
223225
with self.assertRaisesRegex(errors.Error, 'Undefined configuration option "config.a"'):
224226
self.config.a()
225227

228+
@unittest.skipIf(sys.version_info[:2] == (2, 7), 'Python 2.7 does not support this assert')
226229
def test_value_of_undefined_option_with_root_none_in_strict_mode(self):
227230
self.config = providers.Configuration(strict=True)
228231
self.config.override(None)

tests/unit/providers/test_container_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import copy
44

5-
import unittest2 as unittest
5+
import unittest
66

77
from dependency_injector import containers, providers, errors
88

tests/unit/providers/test_coroutines_py35.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import asyncio
44

5-
import unittest2 as unittest
5+
import unittest
66

77
from dependency_injector import (
88
providers,

tests/unit/providers/test_dict_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import sys
44

5-
import unittest2 as unittest
5+
import unittest
66

77
from dependency_injector import providers
88

tests/unit/providers/test_factories_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import sys
44

5-
import unittest2 as unittest
5+
import unittest
66

77
from dependency_injector import (
88
providers,

tests/unit/providers/test_injections_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Dependency injector injections unit tests."""
22

3-
import unittest2 as unittest
3+
import unittest
44

55
from dependency_injector import providers
66

tests/unit/providers/test_list_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import sys
44

5-
import unittest2 as unittest
5+
import unittest
66

77
from dependency_injector import providers
88

tests/unit/providers/test_provided_instance_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Dependency injector provided instance provider unit tests."""
22

3-
import unittest2 as unittest
3+
import unittest
44

55
from dependency_injector import containers, providers
66

tests/unit/providers/test_resource_py35.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import asyncio
44

5-
import unittest2 as unittest
5+
import unittest
66

77
from dependency_injector import containers, providers, resources, errors
88

tests/unit/providers/test_selector_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import itertools
55
import sys
66

7-
import unittest2 as unittest
7+
import unittest
88

99
from dependency_injector import providers, errors
1010

tests/unit/providers/test_singletons_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import sys
44

5-
import unittest2 as unittest
5+
import unittest
66

77
from dependency_injector import (
88
providers,

tests/unit/providers/test_utils_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Dependency injector provider utils unit tests."""
22

3-
import unittest2 as unittest
3+
import unittest
44

55
from dependency_injector import (
66
providers,

tests/unit/test_common_py2_py3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Dependency injector common unit tests."""
22

3-
import unittest2 as unittest
3+
import unittest
44

55
from dependency_injector import __version__
66

tox.ini

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ envlist=
44

55
[testenv]
66
deps=
7-
unittest2
87
# TODO: Hotfix, remove when fixed https://github.com/aio-libs/aiohttp/issues/5107
98
typing_extensions
109
httpx
@@ -15,7 +14,7 @@ extras=
1514
flask
1615
aiohttp
1716
commands=
18-
unit2 discover -s tests/unit -p test_*_py3*.py
17+
python -m unittest discover -s tests/unit -p test_*_py3*.py
1918

2019
[testenv:coveralls]
2120
passenv = GITHUB_* COVERALLS_*
@@ -28,44 +27,40 @@ deps=
2827
coveralls
2928
commands=
3029
coverage erase
31-
coverage run --rcfile=./.coveragerc -m unittest2 discover -s tests/unit/ -p test_*_py3*.py
30+
coverage run --rcfile=./.coveragerc -m unittest discover -s tests/unit/ -p test_*_py3*.py
3231
coverage report --rcfile=./.coveragerc
3332
coveralls
3433

3534
[testenv:2.7]
3635
deps=
37-
unittest2
3836
extras=
3937
yaml
4038
flask
4139
commands=
42-
unit2 discover -s tests/unit -p test_*_py2_py3.py
40+
python -m unittest discover -s tests/unit -p test_*_py2_py3.py
4341

4442
[testenv:3.4]
4543
deps=
46-
unittest2
4744
extras=
4845
flask
4946
commands=
50-
unit2 discover -s tests/unit -p test_*_py3.py
47+
python -m unittest discover -s tests/unit -p test_*_py3.py
5148

5249
[testenv:3.5]
5350
deps=
54-
unittest2
5551
extras=
5652
yaml
5753
flask
5854
commands=
59-
unit2 discover -s tests/unit -p test_*_py3.py
55+
python -m unittest discover -s tests/unit -p test_*_py3.py
6056

6157
[testenv:pypy2]
6258
deps=
63-
unittest2
6459
extras=
6560
yaml
6661
flask
6762
commands=
68-
unit2 discover -s tests/unit -p test_*_py2_py3.py
63+
python -m unittest discover -s tests/unit -p test_*_py2_py3.py
6964

7065
[testenv:pylint]
7166
deps=

0 commit comments

Comments
 (0)