|
7 | 7 | import pytest |
8 | 8 |
|
9 | 9 | from distutils.errors import DistutilsOptionError, DistutilsFileError |
| 10 | +from setuptools._deprecation_warning import SetuptoolsDeprecationWarning |
10 | 11 | from setuptools.dist import Distribution, _Distribution |
11 | 12 | from setuptools.config.setupcfg import ConfigHandler, read_configuration |
12 | 13 | from ..textwrap import DALS |
@@ -409,7 +410,7 @@ def test_deprecated_config_handlers(self, tmpdir): |
409 | 410 | 'requires = some, requirement\n', |
410 | 411 | ) |
411 | 412 |
|
412 | | - with pytest.deprecated_call(): |
| 413 | + with pytest.warns(SetuptoolsDeprecationWarning, match="requires"): |
413 | 414 | with get_dist(tmpdir) as dist: |
414 | 415 | metadata = dist.metadata |
415 | 416 |
|
@@ -518,7 +519,8 @@ def test_basic(self, tmpdir): |
518 | 519 | 'python_requires = >=1.0, !=2.8\n' |
519 | 520 | 'py_modules = module1, module2\n', |
520 | 521 | ) |
521 | | - with get_dist(tmpdir) as dist: |
| 522 | + deprec = pytest.warns(SetuptoolsDeprecationWarning, match="namespace_packages") |
| 523 | + with deprec, get_dist(tmpdir) as dist: |
522 | 524 | assert dist.zip_safe |
523 | 525 | assert dist.include_package_data |
524 | 526 | assert dist.package_dir == {'': 'src', 'b': 'c'} |
@@ -572,7 +574,8 @@ def test_multiline(self, tmpdir): |
572 | 574 | ' http://some.com/here/1\n' |
573 | 575 | ' http://some.com/there/2\n', |
574 | 576 | ) |
575 | | - with get_dist(tmpdir) as dist: |
| 577 | + deprec = pytest.warns(SetuptoolsDeprecationWarning, match="namespace_packages") |
| 578 | + with deprec, get_dist(tmpdir) as dist: |
576 | 579 | assert dist.package_dir == {'': 'src', 'b': 'c'} |
577 | 580 | assert dist.packages == ['pack_a', 'pack_b.subpack'] |
578 | 581 | assert dist.namespace_packages == ['pack1', 'pack2'] |
|
0 commit comments