dmlc / xgboost

Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library, for Python, R, Java, Scala, C++ and more. Runs on single machine, Hadoop, Spark, Dask, Flink and DataFlow
https://xgboost.readthedocs.io/en/stable/
Apache License 2.0
26.32k stars 8.73k forks source link

[pyspark] Convert tests to pytest style. #8337

Open trivialfis opened 2 years ago

trivialfis commented 2 years ago

The tests derived from the python unittest module are not compatible with pytest. For instance, pytest.mark and pytest fixtures are not usable with existing pyspark tests. As a bouns, I think using pytest fixture instead of the setup function from unittest can accelerate the test performance by preventing repeated setups.

Aside from the test framework, we need to remove the use of hardcoded results.

@WeichenXu123 @wbo4958

trivialfis commented 2 years ago

I will convert a couple of them in https://github.com/dmlc/xgboost/pull/8272 .

hcho3 commented 2 years ago

@trivialfis Can you please file a separate PR for the revised tests?

trivialfis commented 2 years ago

will split up the PR.