]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - tests/test_fixture.py
Clean up smoketest and pytests.
[bcachefs-tools-debian] / tests / test_fixture.py
index d8d3819e814427473b4f171a75c09f79d1650312..d96ce88d2311563d80f83ee3e494b6fdf80a5cc2 100644 (file)
@@ -2,16 +2,15 @@
 #
 # Tests of the functions in util.py
 
-import pytest
 import signal
 import subprocess
 import time
+import os
+import pytest
 
-import util
-from pathlib import Path
+from tests import util
 
-#helper = Path('.') / 'test_helper'
-helper = './test_helper'
+helper = os.path.abspath(os.path.join(util.BASE_PATH, 'test_helper'))
 
 def test_sparse_file(tmpdir):
     dev = util.sparse_file(tmpdir / '1k', 1024)
@@ -32,32 +31,32 @@ def test_segfault():
 @pytest.mark.skipif(not util.ENABLE_VALGRIND, reason="no valgrind")
 def test_check():
     with pytest.raises(subprocess.CalledProcessError):
-        ret = util.run(helper, 'abort', check=True)
+        util.run(helper, 'abort', check=True)
 
 @pytest.mark.skipif(not util.ENABLE_VALGRIND, reason="no valgrind")
 def test_leak():
     with pytest.raises(util.ValgrindFailedError):
-        ret = util.run(helper, 'leak', valgrind=True)
+        util.run(helper, 'leak', valgrind=True)
 
 @pytest.mark.skipif(not util.ENABLE_VALGRIND, reason="no valgrind")
 def test_undefined():
     with pytest.raises(util.ValgrindFailedError):
-        ret = util.run(helper, 'undefined', valgrind=True)
+        util.run(helper, 'undefined', valgrind=True)
 
 @pytest.mark.skipif(not util.ENABLE_VALGRIND, reason="no valgrind")
 def test_undefined_branch():
     with pytest.raises(util.ValgrindFailedError):
-        ret = util.run(helper, 'undefined_branch', valgrind=True)
+        util.run(helper, 'undefined_branch', valgrind=True)
 
 @pytest.mark.skipif(not util.ENABLE_VALGRIND, reason="no valgrind")
 def test_read_after_free():
     with pytest.raises(util.ValgrindFailedError):
-        ret = util.run(helper, 'read_after_free', valgrind=True)
+        util.run(helper, 'read_after_free', valgrind=True)
 
 @pytest.mark.skipif(not util.ENABLE_VALGRIND, reason="no valgrind")
 def test_write_after_free():
     with pytest.raises(util.ValgrindFailedError):
-        ret = util.run(helper, 'write_after_free', valgrind=True)
+        util.run(helper, 'write_after_free', valgrind=True)
 
 def test_mountpoint(tmpdir):
     path = util.mountpoint(tmpdir)