@@ -57,7 +57,7 @@ def test_pyflint():
5757 assert 1e-17 < f1 .rad () < 1e-15
5858 assert 1e-4 < f2 .rad () < 1e-3
5959 finally :
60- ctx .prec = oldprec
60+ ctx .dps = olddps
6161
6262 assert ctx .cap == 10
6363 oldcap = ctx .cap
@@ -74,9 +74,11 @@ def test_pyflint():
7474 assert raises (lambda : setattr (ctx , "prec" , - 1 ), ValueError )
7575 assert raises (lambda : setattr (ctx , "dps" , - 1 ), ValueError )
7676
77+
7778def test_showgood ():
7879 from flint import good , showgood
7980
81+
8082def test_fmpz ():
8183 assert flint .fmpz () == flint .fmpz (0 )
8284 L = [0 , 1 , 2 , 3 , 2 ** 31 - 1 , 2 ** 31 , 2 ** 63 - 1 , 2 ** 63 , 2 ** 64 - 1 , 2 ** 64 ]
@@ -246,9 +248,9 @@ def test_fmpz():
246248 assert raises (lambda : f2 ^ (), TypeError )
247249 assert raises (lambda : () ^ f2 , TypeError )
248250
249- l = [1 , 2 , 3 ]
250- l [flint .fmpz (1 )] = - 2
251- assert l == [1 , - 2 , 3 ]
251+ ell = [1 , 2 , 3 ]
252+ ell [flint .fmpz (1 )] = - 2
253+ assert ell == [1 , - 2 , 3 ]
252254 d = {flint .fmpz (2 ): 3 }
253255 d [flint .fmpz (2 )] = - 1
254256
@@ -1635,6 +1637,7 @@ def test_pickling():
16351637 obj2 = pickle .loads (s )
16361638 assert obj == obj2
16371639
1640+
16381641def test_fmpz_mod ():
16391642 from flint import fmpz_mod_ctx , fmpz , fmpz_mod
16401643
@@ -1836,6 +1839,7 @@ def test_fmpz_mod():
18361839 assert fmpz (test_y ) / F_test (test_x ) == (test_y * pow (test_x , - 1 , test_mod )) % test_mod
18371840 assert test_y / F_test (test_x ) == (test_y * pow (test_x , - 1 , test_mod )) % test_mod
18381841
1842+
18391843def test_fmpz_mod_dlog ():
18401844 from flint import fmpz , fmpz_mod_ctx
18411845
@@ -1942,7 +1946,7 @@ def test_fmpz_mod_poly():
19421946 assert raises (lambda : R ([F (1 ), F_other (2 )]), ValueError ) # moduli must match
19431947 assert raises (lambda : R ([F (1 ), "A" ]), TypeError ) # need to be able to cast to fmpz_mod
19441948
1945- f1 = R ([int ( - 1 ), int ( - 2 ), int ( - 3 ) ])
1949+ f1 = R ([- 1 , - 2 , - 3 ])
19461950 f2 = R ([fmpz (- 1 ),fmpz (- 2 ),fmpz (- 3 )])
19471951 f3 = R ([F (- 1 ),F (- 2 ),F (- 3 )])
19481952 f4 = R (fmpz_poly ([- 1 , - 2 , - 3 ]))
@@ -2264,8 +2268,8 @@ def test_fmpz_mod_poly():
22642268 assert raises (lambda : R_test ([1 ,2 ,3 ]).multipoint_evaluate ("AAA" ), ValueError )
22652269
22662270 f = R_test ([1 ,2 ,3 ])
2267- l = [- 1 ,- 2 ,- 3 ,- 4 ,- 5 ]
2268- assert [f (x ) for x in l ] == f .multipoint_evaluate (l )
2271+ ell = [- 1 ,- 2 ,- 3 ,- 4 ,- 5 ]
2272+ assert [f (x ) for x in ell ] == f .multipoint_evaluate (ell )
22692273
22702274 # truncate things
22712275
0 commit comments