| Total Complexity | 3 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """ |
||
| 2 | Tests for the cross-Python version compatibility module |
||
| 3 | """ |
||
| 4 | import platform |
||
| 5 | import sys |
||
| 6 | import pytest |
||
| 7 | |||
| 8 | import pyclean |
||
| 9 | |||
| 10 | |||
| 11 | @pytest.mark.skipif(platform.python_implementation() != 'CPython' |
||
| 12 | or sys.version_info >= (3,) |
||
| 13 | or platform.system() != 'Linux', |
||
| 14 | reason="requires CPython 2 on Debian Linux") |
||
| 15 | def test_detect_py2(): |
||
| 16 | """ |
||
| 17 | Is pyclean implementation returned for Python 2? |
||
| 18 | """ |
||
| 19 | assert pyclean.compat.get_implementation() is pyclean.py2clean |
||
| 20 | |||
| 21 | |||
| 22 | @pytest.mark.skipif(platform.python_implementation() != 'CPython' |
||
| 23 | or sys.version_info < (3,) |
||
| 24 | or platform.system() != 'Linux', |
||
| 25 | reason="requires CPython 3 on Debian Linux") |
||
| 26 | def test_detect_py3(): |
||
| 27 | """ |
||
| 28 | Is py3clean implementation for Python 3? |
||
| 29 | """ |
||
| 30 | assert pyclean.compat.get_implementation() is pyclean.py3clean |
||
| 31 | |||
| 32 | |||
| 33 | @pytest.mark.skipif(platform.python_implementation() != 'PyPy', |
||
| 34 | reason="requires PyPy") |
||
| 35 | def test_detect_pypy(): |
||
| 36 | """ |
||
| 37 | Is pypyclean implementation for PyPy? |
||
| 38 | """ |
||
| 39 | assert pyclean.compat.get_implementation() is pyclean.pypyclean |
||
| 40 |