@@ -248,10 +248,10 @@ def test_it():
248
248
249
249
out .assert_outcomes (passed = 4 , failed = 0 )
250
250
assert out .outlines [9 :13 ] == [
251
+ "test_c.py::test_it PASSED" ,
251
252
"test_b.py::test_it PASSED" ,
252
- "test_a.py::test_it PASSED" ,
253
253
"test_d.py::test_it PASSED" ,
254
- "test_c .py::test_it PASSED" ,
254
+ "test_a .py::test_it PASSED" ,
255
255
]
256
256
257
257
@@ -268,10 +268,10 @@ def test_it():
268
268
269
269
out .assert_outcomes (passed = 4 , failed = 0 )
270
270
assert out .outlines [9 :13 ] == [
271
+ "test_c.py::test_it PASSED" ,
271
272
"test_b.py::test_it PASSED" ,
272
- "test_a.py::test_it PASSED" ,
273
273
"test_d.py::test_it PASSED" ,
274
- "test_c .py::test_it PASSED" ,
274
+ "test_a .py::test_it PASSED" ,
275
275
]
276
276
277
277
@@ -308,9 +308,9 @@ def test_d(self):
308
308
out .assert_outcomes (passed = 4 , failed = 0 )
309
309
assert out .outlines [9 :13 ] == [
310
310
"test_one.py::D::test_d PASSED" ,
311
- "test_one.py::B::test_b PASSED" ,
312
- "test_one.py::C::test_c PASSED" ,
313
311
"test_one.py::A::test_a PASSED" ,
312
+ "test_one.py::C::test_c PASSED" ,
313
+ "test_one.py::B::test_b PASSED" ,
314
314
]
315
315
316
316
@@ -341,8 +341,8 @@ def test_d(self):
341
341
assert out .outlines [9 :13 ] == [
342
342
"test_one.py::T::test_c PASSED" ,
343
343
"test_one.py::T::test_b PASSED" ,
344
- "test_one.py::T::test_a PASSED" ,
345
344
"test_one.py::T::test_d PASSED" ,
345
+ "test_one.py::T::test_a PASSED" ,
346
346
]
347
347
348
348
@@ -368,10 +368,10 @@ def test_d():
368
368
369
369
out .assert_outcomes (passed = 4 , failed = 0 )
370
370
assert out .outlines [9 :13 ] == [
371
- "test_one.py::test_c PASSED" ,
371
+ "test_one.py::test_d PASSED" ,
372
372
"test_one.py::test_a PASSED" ,
373
+ "test_one.py::test_c PASSED" ,
373
374
"test_one.py::test_b PASSED" ,
374
- "test_one.py::test_d PASSED" ,
375
375
]
376
376
377
377
@@ -402,10 +402,10 @@ def test_d():
402
402
403
403
out .assert_outcomes (passed = 4 , failed = 0 )
404
404
assert out .outlines [9 :13 ] == [
405
- "test_one.py::test_c PASSED" ,
405
+ "test_one.py::test_d PASSED" ,
406
406
"test_one.py::test_a PASSED" ,
407
+ "test_one.py::test_c PASSED" ,
407
408
"test_one.py::test_b PASSED" ,
408
- "test_one.py::test_d PASSED" ,
409
409
]
410
410
411
411
@@ -528,7 +528,15 @@ def test_b():
528
528
assert 0
529
529
"""
530
530
)
531
- out = ourtester .runpytest ("-v" , "--randomly-seed=1" , "--stepwise" )
531
+ out = ourtester .runpytest ("-v" , "--randomly-seed=8" )
532
+ out .assert_outcomes (failed = 2 )
533
+ # Ensure test_b runs first
534
+ assert out .outlines [9 :11 ] == [
535
+ "test_one.py::test_b FAILED" ,
536
+ "test_one.py::test_a FAILED" ,
537
+ ]
538
+
539
+ out = ourtester .runpytest ("--randomly-seed=8" , "--stepwise" )
532
540
out .assert_outcomes (failed = 1 )
533
541
534
542
# Now make test_b pass
@@ -543,9 +551,9 @@ def test_b():
543
551
"""
544
552
)
545
553
shutil .rmtree (ourtester .path / "__pycache__" )
546
- out = ourtester .runpytest ("-v" , "-- randomly-seed=1 " , "--stepwise" )
554
+ out = ourtester .runpytest ("-- randomly-seed=8 " , "--stepwise" )
547
555
out .assert_outcomes (passed = 1 , failed = 1 )
548
- out = ourtester .runpytest ("-v" , "-- randomly-seed=1 " , "--stepwise" )
556
+ out = ourtester .runpytest ("-- randomly-seed=8 " , "--stepwise" )
549
557
out .assert_outcomes (failed = 1 )
550
558
551
559
@@ -579,11 +587,11 @@ def test_factory_boy(ourtester):
579
587
from factory.random import randgen
580
588
581
589
def test_a():
582
- assert randgen.random() == 0.9988532989147809
590
+ assert randgen.random() == 0.17867277194477893
583
591
584
592
585
593
def test_b():
586
- assert randgen.random() == 0.18032546798434612
594
+ assert randgen.random() == 0.8026272812225962
587
595
"""
588
596
)
589
597
@@ -599,10 +607,10 @@ def test_faker(ourtester):
599
607
fake = Faker()
600
608
601
609
def test_one():
602
- assert fake.name() == 'Mrs. Lisa Ryan '
610
+ assert fake.name() == 'Kimberly Powell '
603
611
604
612
def test_two():
605
- assert fake.name() == 'Kaitlyn Mitchell '
613
+ assert fake.name() == 'Thomas Moyer PhD '
606
614
"""
607
615
)
608
616
@@ -614,10 +622,10 @@ def test_faker_fixture(ourtester):
614
622
ourtester .makepyfile (
615
623
test_one = """
616
624
def test_one(faker):
617
- assert faker.name() == 'Mrs. Lisa Ryan '
625
+ assert faker.name() == 'Kimberly Powell '
618
626
619
627
def test_two(faker):
620
- assert faker.name() == 'Kaitlyn Mitchell '
628
+ assert faker.name() == 'Thomas Moyer PhD '
621
629
"""
622
630
)
623
631
@@ -634,10 +642,10 @@ def test_model_bakery(ourtester):
634
642
from model_bakery.random_gen import gen_slug
635
643
636
644
def test_a():
637
- assert gen_slug(10) == 'XjpU5br7ej '
645
+ assert gen_slug(10) == 'whwhAKeQYE '
638
646
639
647
def test_b():
640
- assert gen_slug(10) == 'xJHS-PD_WT '
648
+ assert gen_slug(10) == 'o2N4p5UAXd '
641
649
"""
642
650
)
643
651
@@ -651,10 +659,10 @@ def test_numpy(ourtester):
651
659
import numpy as np
652
660
653
661
def test_one():
654
- assert np.random.rand() == 0.36687834264514585
662
+ assert np.random.rand() == 0.1610140063074521
655
663
656
664
def test_two():
657
- assert np.random.rand() == 0.7050715833365834
665
+ assert np.random.rand() == 0.6896867238957805
658
666
"""
659
667
)
660
668
@@ -718,19 +726,19 @@ def fake_entry_points(*, group):
718
726
assert reseed .mock_calls == [
719
727
mock .call (1 ),
720
728
mock .call (1 ),
721
- mock .call (116362448262735926321257785636175308268 ),
722
- mock .call (116362448262735926321257785636175308269 ),
723
- mock .call (116362448262735926321257785636175308270 ),
729
+ mock .call (2964001072 ),
730
+ mock .call (2964001073 ),
731
+ mock .call (2964001074 ),
724
732
]
725
733
726
734
reseed .mock_calls [:] = []
727
735
pytester .runpytest_inprocess ("--randomly-seed=424242" )
728
736
assert reseed .mock_calls == [
729
737
mock .call (424242 ),
730
738
mock .call (424242 ),
731
- mock .call (116362448262735926321257785636175732509 ),
732
- mock .call (116362448262735926321257785636175732510 ),
733
- mock .call (116362448262735926321257785636175732511 ),
739
+ mock .call (2964425313 ),
740
+ mock .call (2964425314 ),
741
+ mock .call (2964425315 ),
734
742
]
735
743
736
744
0 commit comments