master > master: code py - unit tests aktualisiert
This commit is contained in:
@@ -5,9 +5,7 @@
|
||||
# IMPORTS
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
from unittest import TestCase;
|
||||
from pytest import mark;
|
||||
from pytest import fixture;
|
||||
from tests.thirdparty.unit import *;
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# CONSTANTS
|
||||
|
||||
@@ -5,11 +5,7 @@
|
||||
# IMPORTS
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
from contextlib import nullcontext as does_not_raise
|
||||
from collections import Counter;
|
||||
from pytest import mark;
|
||||
from pytest import fixture;
|
||||
from unittest import TestCase;
|
||||
from tests.thirdparty.unit import *;
|
||||
|
||||
from src.models.graphs import *;
|
||||
|
||||
|
||||
@@ -5,14 +5,9 @@
|
||||
# IMPORTS
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
import pytest;
|
||||
from pytest import mark;
|
||||
from pytest import fixture;
|
||||
from pytest import lazy_fixture;
|
||||
from unittest import TestCase;
|
||||
from unittest.mock import patch;
|
||||
|
||||
from tests.thirdparty.unit import *;
|
||||
from src.thirdparty.types import *;
|
||||
|
||||
from src.models.graphs import *;
|
||||
from src.algorithms.tarjan import *;
|
||||
|
||||
@@ -77,7 +72,7 @@ def test_tarjan(test, G, expected):
|
||||
@mark.parametrize(('G', 'expected'), [ (lazy_fixture('graph1'), [[1], [3], [2,4]])])
|
||||
@mark.usefixtures('test')
|
||||
def test_failable_tarjan(test, G, expected):
|
||||
with pytest.raises(AssertionError):
|
||||
with assert_raises(AssertionError):
|
||||
test_tarjan(test, G, expected);
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user