Skip to content

Commit 67af19b

Browse files
committed
Accept suggestions from new toolchain
1 parent fe451a1 commit 67af19b

26 files changed

+103
-58
lines changed

test/old/assert_files_equal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from pathlib import Path
2+
23
from old.vl8.dsp import io
34

45
WRITE_RESULTS = False

test/old/config/test_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from old.vl8.config.config import merge
21
import unittest
32

3+
from old.vl8.config.config import merge
4+
45

56
class TestConfig(unittest.TestCase):
67
def test_merge(self):

test/old/config/test_expand.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from old.vl8.config.expand import Expander
21
import unittest
32

3+
from old.vl8.config.expand import Expander
4+
45
expander = Expander("config", {"money": 3, "love": 10, "murder": 0})
56

67

test/old/config/test_validate.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from pathlib import Path
2-
from old.vl8.config.validate import validate
31
import functools
42
import unittest
3+
from pathlib import Path
4+
5+
from old.vl8.config.validate import validate
56

67

78
class TestValidate(unittest.TestCase):

test/old/dsp/test_envelope.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
from numpy.testing import assert_array_equal
2-
from old.vl8.dsp import envelope
31
import itertools
4-
import numpy as np
52
import unittest
63

4+
import numpy as np
5+
from numpy.testing import assert_array_equal
6+
7+
from old.vl8.dsp import envelope
8+
79

810
class TestSegments(unittest.TestCase):
911
def test_empty(self):

test/old/dsp/test_fader.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import unittest
2+
3+
import numpy as np
14
from numpy.testing import assert_array_almost_equal
5+
26
from old.vl8.dsp.fader import Fader
3-
import numpy as np
4-
import unittest
57

68

79
class TestFader(unittest.TestCase):

test/old/dsp/test_grain.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
from numpy.testing import assert_array_equal
1+
import json
2+
import unittest
23
from pathlib import Path
4+
5+
import numpy as np
6+
from numpy.testing import assert_array_equal
7+
38
from old.vl8.dsp.grain import GrainSamples
49
from old.vl8.dsp.rand import Rand
5-
import json
6-
import numpy as np
7-
import unittest
810

911
RESULTS = Path(__file__).parent / "grain-results.json"
1012

@@ -38,7 +40,7 @@ def test_simple(self):
3840
[[7, 8, 9], [17, 18, 19]],
3941
]
4042
assert len(actual) == len(expected)
41-
for a, e in zip(actual, expected):
43+
for a, e in zip(actual, expected, strict=True):
4244
assert_array_equal(a, e)
4345

4446
def test_variation(self):
@@ -50,7 +52,7 @@ def test_variation(self):
5052
]
5153

5254
assert len(actual) == len(expected)
53-
for a, e in zip(actual, expected):
55+
for a, e in zip(actual, expected, strict=True):
5456
assert_array_equal(a, e)
5557

5658
def test_grain(self):

test/old/dsp/test_io.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
from numpy.testing import assert_array_equal
1+
import unittest
22
from pathlib import Path
3-
from pydub import AudioSegment
4-
from old.vl8.dsp import io
3+
54
import numpy as np
65
import tdir
7-
import unittest
6+
from numpy.testing import assert_array_equal
7+
from pydub import AudioSegment
8+
9+
from old.vl8.dsp import io
810

911
TEST_FILE = Path(__file__).parent / "b-4098.wav"
1012
DIR = Path(__file__).parent / "sources"
@@ -63,7 +65,7 @@ def test_two(self):
6365
d1 = infile.read_bytes()
6466
d2 = outfile.read_bytes()
6567
assert len(d1) == len(d2)
66-
errors = [a for a in enumerate(zip(d1, d2)) if a[1][0] != a[1][1]]
68+
errors = [a for a in enumerate(zip(d1, d2, strict=True)) if a[1][0] != a[1][1]]
6769
assert errors == [(4, (134, 133))]
6870
# AudioSegment changes one bit in the length from the sample
6971

@@ -77,7 +79,7 @@ def test_three(self):
7779
d1 = infile.read_bytes()
7880
d2 = outfile.read_bytes()
7981
assert len(d1) == len(d2)
80-
errors = [a for a in enumerate(zip(d1, d2)) if a[1][0] != a[1][1]]
82+
errors = [a for a in enumerate(zip(d1, d2, strict=True)) if a[1][0] != a[1][1]]
8183
assert errors == [(4, (134, 133))]
8284

8385
def NO_test_pydub_24(self):

test/old/dsp/test_stretch.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
from .. import skip
1+
import unittest
22
from pathlib import Path
3-
from old.vl8.dsp import io
3+
44
import tdir
5-
import unittest
5+
6+
from old.vl8.dsp import io
7+
8+
from .. import skip
69

710
DIR = Path(__file__).parent / "sources"
811

test/old/function/test_bound_function.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from old.vl8.function.bound_function import BoundFunction
21
import unittest
32

3+
from old.vl8.function.bound_function import BoundFunction
4+
45

56
class TestBoundFunction(unittest.TestCase):
67
def test_a_simple_function(self):

0 commit comments

Comments
 (0)