Skip to content

Commit

Permalink
Test using direct imports (#157)
Browse files Browse the repository at this point in the history
This is possible since `poetry` installs the project into the venv by default. It helps ensure that functions under test are properly exported in `__all__`.
  • Loading branch information
paulmelnikow authored Jul 10, 2021
1 parent 24684a3 commit 25e059f
Show file tree
Hide file tree
Showing 29 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion vg/test_aligned_with.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import pytest
from . import core as vg
import vg


def test_aligned_with():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_almost_collinear.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from . import core as vg
import vg


def test_almost_collinear():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_almost_equal.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from . import core as vg
import vg


def test_almost_equal():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_almost_unit_length.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import math
import numpy as np
from . import core as vg
import vg


def test_almost_unit_length():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_almost_zero.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from . import core as vg
import vg


def test_almost_zero():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_angle.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
import numpy as np
import pytest
from . import core as vg
import vg


def test_basic():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_apex.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import pytest
from . import core as vg
import vg


def test_apex_functions():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_average.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from . import core as vg
import vg


def test_average():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_basis.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from . import core as vg
import vg


def test_constants():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_cross.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import pytest
from . import core as vg
import vg


def test_cross():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_dot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import pytest
from . import core as vg
import vg


def test_dot():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_euclidean_distance.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import math
import numpy as np
from . import core as vg
import vg


def test_euclidean_distance():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_farthest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import pytest
from . import core as vg
import vg


def test_farthest():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_magnitude.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
import numpy as np
import pytest
from . import core as vg
import vg


def test_magnitude():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_matrix_pad_with_ones.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import pytest
from .matrix import pad_with_ones
from vg.matrix import pad_with_ones


def test_pad_with_ones():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_matrix_transform.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import pytest
from .matrix import transform as apply_transform
from vg.matrix import transform as apply_transform

scale_factor = np.array([3.0, 0.5, 2.0])
transform = np.array(
Expand Down
2 changes: 1 addition & 1 deletion vg/test_matrix_unpad.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import pytest
from .matrix import unpad
from vg.matrix import unpad


def test_unpad():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_nearest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from . import core as vg
import vg


def test_nearest():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_normalize.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
import numpy as np
import pytest
from . import core as vg
import vg


def test_normalize():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_pca.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from . import core as vg
import vg


def test_principal_components():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_perpendicular.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
import numpy as np
import pytest
from . import core as vg
import vg


def test_perpendicular():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_project.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import pytest
from . import core as vg
import vg


def test_project():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_reject.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from . import core as vg
import vg


def test_reject():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_reject_axis.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import pytest
from . import core as vg
import vg


def test_reject_axis():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_rotate.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
import numpy as np
import pytest
from . import core as vg
import vg


around_axis = np.array([0.0, 2.0, -1.0])
Expand Down
2 changes: 1 addition & 1 deletion vg/test_scale_factor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from . import core as vg
import vg


def test_scale_factor():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_shape.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import pytest
from .shape import check, check_value, check_value_any, columnize
from vg.shape import check, check_value, check_value_any, columnize


def test_check_value_valid():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_signed_angle.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from . import core as vg
import vg


def test_basic():
Expand Down
2 changes: 1 addition & 1 deletion vg/test_within.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
import pytest
from . import core as vg
import vg


def test_within():
Expand Down

0 comments on commit 25e059f

Please sign in to comment.