Skip to content

Commit

Permalink
Tests: Update sysconfig test to not depend on obsolete data files.
Browse files Browse the repository at this point in the history
The pyconfig.h and makefile are no longer used. The correct way to
use sysconfig is through `sysconfig.get_config_vars()` which
is now tested instead of checking the files are present.
  • Loading branch information
bwoodsend committed Oct 3, 2020
1 parent 8edf0f0 commit dc8e7fc
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tests/functional/test_basic.py
Expand Up @@ -332,9 +332,20 @@ def MyEXE(*args, **kwargs):
_, err = capsys.readouterr()
assert "'import warnings' failed" not in err

@skipif_win
def test_python_makefile(pyi_builder):
pyi_builder.test_script('pyi_python_makefile.py')

@pytest.mark.parametrize("distutils", ["", "from distutils "])
def test_python_makefile(pyi_builder, distutils):
"""Tests hooks for ``sysconfig`` and its near-duplicate
``distutils.sysconfig``. Should raise a distutils error if it needed the
``pyconfig.h`` and ``makefile`` and didn't get them. Or an import error if
we failed to include the special extension module that replaced those
files in more modern Python versions.
"""
pyi_builder.test_source("""
{}import sysconfig
from pprint import pprint
pprint(sysconfig.get_config_vars())
""".format(distutils))


def test_set_icon(pyi_builder, data_dir):
Expand Down

0 comments on commit dc8e7fc

Please sign in to comment.