Marcel Telka
2024-04-03 72d66ff28ec33bc2c05b355c6218d98d13b79450
commit | author | age
68e97f 1 #
MT 2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
6 #
7 # A full copy of the text of the CDDL should have accompanied this
8 # source.  A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
10 #
11
12 #
13 # Copyright 2023 Marcel Telka
14 #
15
16 %patch% 02-requirements-path.patch
17 %patch% 03-pytest-disable-plugins.patch
18 %patch% 04-no-cov.patch
19 %patch% 05-test-disable-failing.patch
20 %patch% 06-remove-test-reqs.patch
21
22 %include-3%
23 # This project does not support tox so we need to provide test requirements
24 # manually.
fdc247 25 TEST_REQUIREMENTS += requirements/test.in
68e97f 26
MT 27 #
28 # Tests are run from build directory that contains cloned copy of sdist.  We
29 # try to ask Python to find tested modules in the proto area (the PYTHONPATH is
30 # set accordingly), but Python (< 3.11) always adds the current directory to
31 # sys.path and there is no known (simple) way how to avoid that.  Except -I,
32 # but that would cause Python to ignore PYTHONPATH too so we would not have
33 # access to the proto area either.  The -P option together with PYTHONSAFEPATH
34 # environment variable were added to Python 3.11 only so we cannot use them yet
35 # for all Python versions we support.
36 #
37 # Since sdist for this project contains the main module in the top-level
38 # directory we cannot force Python to skip it.  But, unfortunately, this module
39 # does not contain built dynamic libraries, so Python cannot find them while
40 # testing.
41 #
42 # To workaround this we rename the main module in the build directory during
43 # testing so Python will need to defer to PYTHONPATH.
44 #
45 COMPONENT_PRE_TEST_ACTION +=    $(MV) $(@D)/aiohttp $(@D)/aiohttp-RENAMED ;
46 COMPONENT_POST_TEST_ACTION +=    $(MV) $(@D)/aiohttp-RENAMED $(@D)/aiohttp ;
47
48 # We need to ignore tests in test_proxy_functional.py because we do not have
49 # the proxy.py Python project packaged yet.
50 PYTEST_ADDOPTS += --ignore tests/test_proxy_functional.py
fdc247 51 # We have no python-on-whales packaged yet.
MT 52 PYTEST_ADDOPTS += --ignore tests/autobahn/test_autobahn.py