Test Failed
Branch master (43347c)
by Peter
01:10
created

test_compat   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 3
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