Question: I have about 10 tests in same file and each one them has following set to execute in order

```
import pytest
@pytest.mark.order1
.
.
.
@pytest.mark.order10

```

But the tests never run in the order they are assigned. They always run in the order they are arranged. Anything I am missing ?

even ***@pytest.mark.tryfirst*** didn't work. One thing I noticed is, the ***@pytest.mark.order*** never shows up in suggestions while atleast ***@pyetst.mark.tryfirst*** was there in pycharm.

Answer: 
I faced the same issue, you can use this command to order it:

```
@pytest.mark.run(order=1)

```

But before, install it from this [site](https://pypi.org/project/pytest-ordering/).  

Then it will work fine.
The pytest marks do not do anything special, except for marking the tests. The marks can be used only for the purpose of filtering them with `-m` CLI option.

This is all pytest alone can do with the marks. Well, and few little things like parameterization & skipif's.

Specifically, there is no such special mark as `tryfirst`. It is a parameter to the hook declaration, but this is not applicable for the tests/marks.

Some external or internal plugins can add special behavior which is dependent on the marks.

Pytest executes the tests in the order they were found (collected). In some cases, pytest can reorder (regroup) the tests for better fixture usage. At least, this is declared; not sure if actually done.

The tests are assumed to be completely independent by design. If your tests depend on each another, e.g. use the state of the system under test from the previous test-cases, you have a problem with the test design. That state should be somehow converted to the fixture(s).

If you still want to force some dependencies or order of the tests (contrary to the test design principles), you have to install a plugin for the test ordering based on marks, e.g., <http://pytest-ordering.readthedocs.io/en/develop/>, and mark the tests according to its supported mark names.