qtsass icon indicating copy to clipboard operation
qtsass copied to clipboard

Python 3.10 incompatibility

Open bgermann opened this issue 4 years ago • 0 comments

From https://bugs.debian.org/1009456:

============================= test session starts ============================== platform linux -- Python 3.10.4, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 rootdir: /<<PKGBUILDDIR>> collected 37 items

tests/test_api.py ......... [ 24%] tests/test_cli.py ....... [ 43%] tests/test_conformers.py ............ [ 75%] tests/test_functions.py ..... [ 89%] tests/test_watchers.py .Fs. [100%]

=================================== FAILURES =================================== ___________________________ test_watchers[QtWatcher] ___________________________

Watcher = <class 'qtsass.watchers.qt.QtWatcher'> tmpdir = local('/tmp/pytest-of-user42/pytest-8/test_watchers_QtWatcher_0')

@pytest.mark.parametrize(
    'Watcher', (PollingWatcher, QtWatcher),
)
def test_watchers(Watcher, tmpdir):
    """Stress test Watcher implementations"""

    # Skip when QtWatcher is None - when Qt is not installed.
    if not Watcher:
        return

    watch_dir = tmpdir.join('src').strpath
    os.makedirs(watch_dir)
    shutil.copy2(example('dummy.scss'), watch_dir)
    input = tmpdir.join('src/dummy.scss').strpath
    output = tmpdir.join('build/dummy.css').strpath
    output_exists = lambda: exists(output)

    c = CallCounter()
    w = Watcher(
        watch_dir=watch_dir,
        compiler=compile_filename,
        args=(input, output),
    )
    w.connect(c)

    # Output should not yet exist
    assert not exists(output)

    w.start()

    touch(input)
    time.sleep(0.5)
    if not await_condition(output_exists):
        assert False, 'Output file not created...'

    # Removing the watch_dir should not kill the Watcher
    # simply stop dispatching callbacks
    shutil.rmtree(watch_dir)
    time.sleep(0.5)
    assert c.count == 1

    # Watcher should recover once the input file is there again
    os.makedirs(watch_dir)
    shutil.copy2(example('dummy.scss'), watch_dir)
    time.sleep(0.5)
  assert c.count == 2

E assert 1 == 2 E + where 1 = <tests.test_watchers.CallCounter object at 0x7f08d54935e0>.count

tests/test_watchers.py:87: AssertionError =========================== short test summary info ============================ FAILED tests/test_watchers.py::test_watchers[QtWatcher] - assert 1 == 2 =================== 1 failed, 35 passed, 1 skipped in 11.59s ===================

bgermann avatar Apr 20 '22 10:04 bgermann