Switch from nose to pytest for tests
As nose is in maintenance mode and might cease in the near future, we should switch to pytest to run the tests in continuous integration.
As some of the tests use random generation, we should also use pytest-randomly to manage the random seeds.