Skip to content

Commit 869b8b2

Browse files
committed
Replace custom test runner with pytest runner
1 parent 28a0f61 commit 869b8b2

32 files changed

+1003
-1204
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,10 @@ venv
3434
# IDEs
3535
.vscode
3636
.idea
37+
38+
# Test coverage
39+
.coverage
40+
41+
# Cache
42+
.pytest_cache
43+
.mypy_cache

README.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ def calc_pi_device(samples):
2222
return 4 * af.count(within_unit_circle) / samples
2323
```
2424

25-
26-
Choosing a particular backend can be done using `af.set_backend(name)` where name is either "_cuda_", "_opencl_", or "_cpu_". The default device is chosen in the same order of preference.
25+
Choosing a particular backend can be done using `af.set_backend(name)` where name is either "_cuda_", "_opencl_", or "_cpu_". The default device is chosen in the same order of preference.
2726

2827
## Requirements
2928

@@ -41,19 +40,19 @@ Please check the following links for dependencies.
4140

4241
**Install the last stable version:**
4342

44-
```
43+
```bash
4544
pip install arrayfire
4645
```
4746

4847
**Install the development version:**
4948

50-
```
49+
```bash
5150
pip install git+git://github.com/arrayfire/arrayfire-python.git@devel
5251
```
5352

5453
**Installing offline:**
5554

56-
```
55+
```bash
5756
cd path/to/arrayfire-python
5857
python setup.py install
5958
```
@@ -62,16 +61,16 @@ python setup.py install
6261

6362
Please follow [these instructions](https://github.com/arrayfire/arrayfire-python/wiki) to ensure the arrayfire-python can find the arrayfire libraries.
6463

65-
To run arrayfire tests, you can run the following command from command line.
64+
To run arrayfire smoke tests, you can run the following command from command line.
6665

67-
```
68-
python -m arrayfire.tests
66+
```bash
67+
python setup.py test
6968
```
7069

7170
## Communication
7271

73-
* [Slack Chat](https://join.slack.com/t/arrayfire-org/shared_invite/MjI4MjIzMDMzMTczLTE1MDI5ODg4NzYtN2QwNGE3ODA5OQ)
74-
* [Google Groups](https://groups.google.com/forum/#!forum/arrayfire-users)
72+
- [Slack Chat](https://join.slack.com/t/arrayfire-org/shared_invite/MjI4MjIzMDMzMTczLTE1MDI5ODg4NzYtN2QwNGE3ODA5OQ)
73+
- [Google Groups](https://groups.google.com/forum/#!forum/arrayfire-users)
7574

7675
## Acknowledgements
7776

setup.cfg

+19-1
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,32 @@ classifiers =
1717
[options]
1818
packages = find:
1919
python_requires = >=3.6.0
20+
setup_requires =
21+
pytest-runner
22+
tests_require =
23+
flake8-import-order
24+
flake8-quotes
25+
pytest-cov
26+
pytest-flake8
27+
pytest-mypy
2028

2129
[options.packages.find]
22-
include = arrayfire
2330
exclude =
2431
examples
2532
tests
2633

34+
[aliases]
35+
test = pytest
36+
2737
[flake8]
2838
application-import-names = arrayfire
2939
import-order-style = pep8
3040
max-line-length = 119
41+
42+
[tool:pytest]
43+
addopts = --cache-clear --cov=arrayfire --cov-fail-under=70
44+
console_output_style = classic
45+
46+
[coverage:report]
47+
show_missing = true
48+
skip_covered = true

tests/__init__.py

-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +0,0 @@
1-
#!/usr/bin/env python
2-
3-
#######################################################
4-
# Copyright (c) 2019, ArrayFire
5-
# All rights reserved.
6-
#
7-
# This file is distributed under 3-clause BSD license.
8-
# The complete license agreement can be obtained at:
9-
# http://arrayfire.com/licenses/BSD-3-Clause
10-
########################################################

tests/__main__.py

-51
This file was deleted.

tests/simple/__init__.py

-44
This file was deleted.

tests/simple/_util.py

-62
This file was deleted.

tests/simple/algorithm.py

-120
This file was deleted.

0 commit comments

Comments
 (0)