File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
# coding: utf-8
2
2
"""Core tests for wcwidth module."""
3
3
# 3rd party
4
- import pkg_resources
4
+ try :
5
+ import importlib .metadata as importmeta
6
+ except ImportError :
7
+ import importlib_metadata as importmeta
5
8
6
9
# local
7
10
import wcwidth
10
13
def test_package_version ():
11
14
"""wcwidth.__version__ is expected value."""
12
15
# given,
13
- expected = pkg_resources . get_distribution ('wcwidth' ). version
16
+ expected = importmeta . version ('wcwidth' )
14
17
15
18
# exercise,
16
19
result = wcwidth .__version__
Original file line number Diff line number Diff line change 5
5
6
6
# 3rd party
7
7
import pytest
8
- import pkg_resources
9
8
10
9
# local
11
10
import wcwidth
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ skip_missing_interpreters = true
5
5
[testenv]
6
6
deps = pytest ==4.6.10
7
7
pytest-cov ==2.8.1
8
+ importlib_metadata; python_version < '3.8'
8
9
commands = {envpython} -m pytest --cov-config ={toxinidir}/tox.ini {posargs:\
9
10
--strict --verbose \
10
11
--junit-xml =.tox/results.{envname}.xml \
You can’t perform that action at this time.
0 commit comments