Skip to content

Commit

Permalink
feature prepared for py311 (Open-MSS#1923)
Browse files Browse the repository at this point in the history
* prepared for py311

* skipped needs review

* enables worker restart

* worker restart

* skip test

* because of deprecation of grid_b and change to visible we need 3.7

* disabled fixture

* fixed deprecation

* disabled test without asserts

* skip test

* module added

* test skipped

* test skipped

* test skipped

* skip tests

* trying other ports

* flake8

* skip test

* undo test changes

* skip test

* typo

* flake8

* set start condition

* skip early

* check added
ReimarBauer authored Nov 14, 2023
1 parent d297a00 commit be3e513
Showing 6 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ jobs:
&& source /opt/conda/etc/profile.d/conda.sh \
&& source /opt/conda/etc/profile.d/mamba.sh \
&& mamba activate mss-${{ inputs.branch_name }}-env \
&& pytest -vv -n 6 --dist loadfile --max-worker-restart 0 tests \
&& pytest -vv -n 6 --dist loadfile --max-worker-restart 4 tests \
|| (for i in {1..5} \
; do pytest -vv -n 6 --dist loadfile --max-worker-restart 0 tests --last-failed --lfnf=none \
&& break \
1 change: 0 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
@@ -246,7 +246,6 @@ def fail_if_open_message_boxes_left():
except RuntimeError:
pass


@pytest.fixture(scope="session", autouse=True)
def configure_testsetup(request):
if Display is not None:
6 changes: 3 additions & 3 deletions localbuild/meta.yaml
Original file line number Diff line number Diff line change
@@ -40,16 +40,16 @@ requirements:
- chameleon
- execnet
- fastkml =0.11
- shapely <2.0.0
- shapely >=2.0.0
- pygeoif <1.0.0
- isodate
- lxml
- netcdf4
- hdf4
- pillow
- pytz
- pyqt >=5, <5.13
- qt >=5.10, <5.13
- pyqt >=5.15.0
- qt >=5.15.0
- requests >=2.31.0
- scipy
- skyfield >=1.12
4 changes: 2 additions & 2 deletions tests/_test_msui/test_mss.py
Original file line number Diff line number Diff line change
@@ -24,13 +24,13 @@
See the License for the specific language governing permissions and
limitations under the License.
"""


import pytest
import sys
from PyQt5 import QtWidgets, QtTest, QtCore
from mslib.msui import mss


@pytest.mark.skip(reason='needs review, assert missing')
def test_mss_rename_message():
application = QtWidgets.QApplication(sys.argv)
main_window = mss.MSSMainWindow()
3 changes: 1 addition & 2 deletions tests/_test_msui/test_wms_control.py
Original file line number Diff line number Diff line change
@@ -151,10 +151,9 @@ def test_invalid_url(self, mockbox):
self.query_server(f"http://???127.0.0.1:{self.port}")
assert mockbox.critical.call_count == 1

@pytest.mark.skip("problem in urllib3")
@mock.patch("PyQt5.QtWidgets.QMessageBox")
def test_connection_error(self, mockbox):
if sys.version_info.major == 3:
pytest.skip("problem in urllib3")
"""
assert that a message box informs about server troubles
"""
6 changes: 6 additions & 0 deletions tests/_test_utils/test_auth.py
Original file line number Diff line number Diff line change
@@ -48,12 +48,16 @@ def test_keyring():


def test_get_auth_from_url_and_name():
# set start condition to prevent definitions from a test earlier
constants.AUTH_LOGIN_CACHE == {}
# empty http_auth definition
server_url = "http://example.com"
http_auth = config_loader(dataset="MSS_auth")
assert http_auth == {}
data = auth.get_auth_from_url_and_name(server_url, http_auth, overwrite_login_cache=False)
assert data == (None, None)
# checking if the test setup changes this
assert constants.AUTH_LOGIN_CACHE == {}
# auth username and url defined
auth_username = 'mss'
create_msui_settings_file(f'{{"MSS_auth": {{"http://example.com": "{auth_username}"}}}}')
@@ -63,6 +67,8 @@ def test_get_auth_from_url_and_name():
data = auth.get_auth_from_url_and_name(server_url, http_auth, overwrite_login_cache=False)
# no password yet
assert data == (auth_username, None)
# checking if the test setup changes this
assert constants.AUTH_LOGIN_CACHE == {}
# store a password
auth.save_password_to_keyring(server_url, auth_username, "password")
# return the test password

0 comments on commit be3e513

Please sign in to comment.