1
1
pytest-random-order
2
2
===================================
3
3
4
- This is a ** pytest ** plugin to randomise the order in which tests are run with a little bit of control
4
+ This is a pytest plugin ** to randomise the order ** in which tests are run ** with some control **
5
5
over how much randomness one allows.
6
6
7
7
It is a good idea to randomise the order in which your tests run
8
8
because a test running early as part of a larger suite of tests may have left
9
9
the system under test in a particularly fortunate state for a subsequent test to pass.
10
10
11
11
How Random
12
- __________
12
+ ----------
13
13
14
14
**pytest-random-order ** groups tests in buckets, shuffles them within buckets and then shuffles the buckets.
15
15
16
- User can choose among four types of buckets to use :
16
+ You can choose from four types of buckets:
17
17
18
18
* ``class ``
19
- * ``module `` -- **this is the default setting **
19
+ * ``module `` - **this is the default setting **
20
20
* ``package ``
21
- * ``global `` -- all tests fall in the same bucket, full randomness, tests probably take longer to run
21
+ * ``global `` - all tests fall in the same bucket, full randomness, tests probably take longer to run
22
22
23
23
If you have three buckets of tests ``A ``, ``B ``, and ``C `` with three tests ``1 `` and ``2 ``, and ``3 `` in each of them,
24
24
then here are just two of many potential orderings that non-global randomisation can produce:
@@ -33,8 +33,8 @@ As you can see, all C tests are executed "next" to each other and so are tests i
33
33
Tests from any bucket X are guaranteed to not be interspersed with tests from another bucket Y.
34
34
For example, if you choose bucket type ``module `` then bucket X contains all tests that are in this module.
35
35
36
- Note that modules (and hence tests inside those modules) that belong to package ``x.y `` do not belong
37
- to package ``x.y.z ``, so they will fall in different buckets when randomising with ``package `` bucket type.
36
+ Note that modules (and hence tests inside those modules) that belong to package ``x.y.z `` do not belong
37
+ to package ``x.y ``, so they will fall in different buckets when randomising with ``package `` bucket type.
38
38
39
39
By default, your tests will be randomised at ``module `` level which means that
40
40
tests within a single module X will be executed in no particular order, but tests from
0 commit comments