Skip to content

Commit

Permalink
Merge pull request #207 from pitkajuh/remove-unused-python-modules
Browse files Browse the repository at this point in the history
Remove unused Python modules
  • Loading branch information
wlav committed Jan 9, 2024
2 parents f782cd7 + 76206c5 commit b459c74
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 45 deletions.
2 changes: 1 addition & 1 deletion test/test_aclassloader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py
from pytest import raises
from .support import setup_make

Expand Down
3 changes: 1 addition & 2 deletions test/test_advancedcpp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py
from pytest import raises, skip
from .support import setup_make, pylong, IS_WINDOWS, ispypy

Expand Down Expand Up @@ -958,4 +958,3 @@ def __cast_cpp__(self):

for norm in [ns.norm_cr, ns.norm_m, ns.norm_v]:
assert round(norm(p3) - pynorm, 8) == 0

1 change: 0 additions & 1 deletion test/test_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import py, os, sys
from pytest import raises, skip
from .support import ispypy

Expand Down
2 changes: 1 addition & 1 deletion test/test_boost.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import os
from pytest import mark, raises, skip
from .support import setup_make

Expand Down
2 changes: 0 additions & 2 deletions test/test_concurrent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import py, os, sys
from pytest import raises, skip
from .support import IS_MAC_ARM

Expand Down Expand Up @@ -300,4 +299,3 @@ def test(i, state=State):

assert State.c1 == 1000
assert State.c2 == State.c3

3 changes: 1 addition & 2 deletions test/test_conversions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py
from pytest import raises
from .support import setup_make

Expand Down Expand Up @@ -125,4 +125,3 @@ def test05_bool_conversions(self):
assert ns.Test1()
assert ns.Test2(True)
assert not ns.Test2(False)

2 changes: 1 addition & 1 deletion test/test_cpp11features.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py, sys
from pytest import raises
from .support import setup_make, ispypy

Expand Down
4 changes: 2 additions & 2 deletions test/test_crossinheritance.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py, os
from pytest import raises, skip
from .support import setup_make, pylong, IS_MAC_ARM

Expand Down Expand Up @@ -723,7 +723,7 @@ class Base2 {
class Base : public Base1, public Base2 {
public:
Result abstract2() override { return Result(999); }
Result abstract2() override { return Result(999); }
}; } """)

ns = cppyy.gbl.cpp_side_multiple_inheritance
Expand Down
4 changes: 1 addition & 3 deletions test/test_datatypes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py, sys
from pytest import raises, skip
from .support import setup_make, pylong, pyunicode

Expand Down Expand Up @@ -2353,5 +2353,3 @@ def test50_int8_uint8_global_arrays(self):

assert [ns.test[i] for i in range(6)] == [-0x12, -0x34, -0x56, -0x78, 0x0, 0x0]
assert [ns.utest[i] for i in range(6)] == [ 0x12, 0x34, 0x56, 0x78, 0x0, 0x0]


2 changes: 1 addition & 1 deletion test/test_doc_features.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py, sys
from pytest import raises, skip
from .support import setup_make, ispypy, IS_WINDOWS

Expand Down
2 changes: 1 addition & 1 deletion test/test_eigen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py, os
from pytest import mark, raises
from .support import setup_make

Expand Down
2 changes: 1 addition & 1 deletion test/test_lowlevel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py, sys
from pytest import raises, skip
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy

Expand Down
26 changes: 13 additions & 13 deletions test/test_numba.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import os
import math, time
from pytest import mark, raises
from .support import setup_make
Expand Down Expand Up @@ -421,7 +421,7 @@ class Box{
void inc(long* value) {
(*value)++;
}
};
};
}
""")

Expand Down Expand Up @@ -477,27 +477,27 @@ def test12_std_vector_pass_by_ref(self):
class BoxVector{
public:
std::vector<long>* a;
BoxVector() : a(new std::vector<long>()) {}
BoxVector(std::vector<long>* i) : a(i){}
void square_vec(){
for (auto& num : *a) {
num = num * num;
}
}
void add_2_vec(long k){
for (auto& num : *a) {
num = num + k;
}
}
void append_vector(const std::vector<long>& value) {
*a = make_vector(value, *a);
}
};
};
}
""")
ns = cppyy.gbl.RefTest
Expand Down Expand Up @@ -568,32 +568,32 @@ class DotVector{
private:
std::vector<long>* a;
std::vector<long>* b;
public:
long g = 0;
long *res = &g;
DotVector(std::vector<long>* i, std::vector<long>* j) : a(i), b(j) {}
long self_dot_product() {
long result = 0;
size_t size = a->size(); // Cache the vector size
const long* data_a = a->data();
const long* data_b = b->data();
for (size_t i = 0; i < size; ++i) {
result += data_a[i] * data_b[i];
}
return result;
}
long dot_product(const std::vector<long>& vec1, const std::vector<long>& vec2) {
long result = 0;
for (size_t i = 0; i < vec1.size(); ++i) {
result += vec1[i] * vec2[i];
}
return result;
}
};
};
}""")

@numba.njit()
Expand Down
2 changes: 1 addition & 1 deletion test/test_operators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py
from pytest import raises, skip
from .support import setup_make, pylong, maxvalue, IS_WINDOWS

Expand Down
3 changes: 1 addition & 2 deletions test/test_overloads.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py
from pytest import raises, skip
from .support import setup_make, ispypy, IS_WINDOWS

Expand Down Expand Up @@ -254,4 +254,3 @@ class MyClass3 {

with raises(TypeError):
ns.MyClass3("some_file")

6 changes: 3 additions & 3 deletions test/test_pythonify.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py
from pytest import raises, skip
from .support import setup_make, pylong, ispypy

Expand Down Expand Up @@ -99,7 +99,7 @@ def test04_constructing_and_calling(self):
instance = example01_class(-13)
res = instance.addDataToDouble(16)
assert round(res-3, 8) == 0.
instance.__destruct__()
instance.__destruct__()

instance = example01_class(42)
assert example01_class.getCount() == 1
Expand Down Expand Up @@ -455,7 +455,7 @@ def verify_b(b, val, ti, to):
b = B(17, val=23, out_A=(78,))

with raises(TypeError):
b = B(17, out_A=(78,))
b = B(17, out_A=(78,))

# global function with keywords
callme = cppyy.gbl.KeyWords.callme
Expand Down
2 changes: 1 addition & 1 deletion test/test_pythonization.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py, sys
from pytest import raises
from .support import setup_make, pylong

Expand Down
3 changes: 1 addition & 2 deletions test/test_regression.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import os, sys
from pytest import raises, skip
from .support import setup_make, IS_WINDOWS, ispypy

Expand Down Expand Up @@ -1272,4 +1272,3 @@ def test42_char_arrays_consistence(self):
assert foo.values[1].as_string() == world
assert foo.pointers[0] == 'hello'
assert foo.pointers[1] == 'world!'

4 changes: 2 additions & 2 deletions test/test_stltypes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: UTF-8 -*-
import py, os, sys
import py, sys
from pytest import raises, skip
from .support import setup_make, pylong, pyunicode, maxvalue, ispypy

Expand Down Expand Up @@ -221,7 +221,7 @@ def test01_builtin_type_vector_types(self):
assert tv1 is tv2
assert tv1.iterator is cppyy.gbl.std.vector(p_type).iterator

#-----
#-----
v = tv1()
assert not v
v += range(self.N)
Expand Down
3 changes: 1 addition & 2 deletions test/test_streams.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os, sys
import py
from pytest import raises
from .support import setup_make

Expand Down Expand Up @@ -73,4 +73,3 @@ def test04_naming_of_ostringstream(self):
assert cl0 == cl1
assert cl1 == cl2
assert cl2 == cl0

2 changes: 1 addition & 1 deletion test/test_templates.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import py, os
import py
from pytest import raises
from .support import setup_make, pylong

Expand Down

0 comments on commit b459c74

Please sign in to comment.