Repository: pyqtgraph/pyqtgraph

Issue:
[CI-fail] on azure-pipelines, windows pip builds aren't running...
When azure-pipelines attempts to run the tests on Windows-pip builds (PyQt5-5.12, and PySide2-5.12), the following error is generated:

```
    import fcntl
ModuleNotFoundError: No module named 'fcntl'
```

likely the template needs to be modified to include that package.


Discussion:
turns out this is an issue due to pytest-xvfb being present on windows installations; I'm tweaking the azure pipeliens configurations on my own branch, will eventually make a PR once I'm done, and close this issue then...

Resolving patch:
diff --git a/pyqtgraph/graphicsItems/ROI.py b/pyqtgraph/graphicsItems/ROI.py
--- a/pyqtgraph/graphicsItems/ROI.py
+++ b/pyqtgraph/graphicsItems/ROI.py
@@ -1553,7 +1553,7 @@ def __init__(self, pos, size, centered=False, sideScalers=False, **args):
             self.addScaleHandle([0.5, 1], [0.5, center[1]])
 
 class LineROI(ROI):
-    """
+    r"""
     Rectangular ROI subclass with scale-rotate handles on either side. This
     allows the ROI to be positioned as if moving the ends of a line segment.
     A third handle controls the width of the ROI orthogonal to its "line" axis.
diff --git a/pyqtgraph/util/get_resolution.py b/pyqtgraph/util/get_resolution.py
new file mode 100644
--- /dev/null
+++ b/pyqtgraph/util/get_resolution.py
@@ -0,0 +1,7 @@
+from .. import mkQApp
+
+
+def getResolution():
+    qApp = mkQApp()
+    desktop = qApp.desktop().screenGeometry()
+    return (desktop.width(), desktop.height())


Test patch:
diff --git a/pyqtgraph/tests/image_testing.py b/pyqtgraph/tests/image_testing.py
--- a/pyqtgraph/tests/image_testing.py
+++ b/pyqtgraph/tests/image_testing.py
@@ -213,7 +213,7 @@ def assertImageApproved(image, standardFile, message=None, **kwargs):
                 if os.getenv('TRAVIS') is not None:
                     saveFailedTest(image, stdImage, standardFile, upload=True)
                 elif os.getenv('AZURE') is not None:
-                    standardFile = r"artifacts/" + standardFile
+                    standardFile = os.path.join(os.getenv("SCREENSHOT_DIR", "screenshots"), standardFile)
                     saveFailedTest(image, stdImage, standardFile)
                 print(graphstate)
                 raise
@@ -288,11 +288,6 @@ def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50.,
 def saveFailedTest(data, expect, filename, upload=False):
     """Upload failed test images to web server to allow CI test debugging.
     """
-    commit = runSubprocess(['git', 'rev-parse',  'HEAD'])
-    name = filename.split(os.path.sep)
-    name.insert(-1, commit.strip())
-    filename = os.path.sep.join(name)
-
     # concatenate data, expect, and diff into a single image
     ds = data.shape
     es = expect.shape
@@ -318,8 +313,14 @@ def saveFailedTest(data, expect, filename, upload=False):
         "%s %s" % (data.shape, data.dtype, expect.shape, expect.dtype))
     if upload:
         uploadFailedTest(filename, png)
-    
+
+
 def uploadFailedTest(filename, png):
+    commit = runSubprocess(['git', 'rev-parse',  'HEAD'])
+    name = filename.split(os.path.sep)
+    name.insert(-1, commit.strip())
+    filename = os.path.sep.join(name)
+
     host = 'data.pyqtgraph.org'
     conn = httplib.HTTPConnection(host)
     req = urllib.urlencode({'name': filename,
diff --git a/pyqtgraph/tests/test_display.py b/pyqtgraph/tests/test_display.py
new file mode 100644
--- /dev/null
+++ b/pyqtgraph/tests/test_display.py
@@ -0,0 +1,10 @@
+from .. import mkQApp
+
+qApp = mkQApp()
+
+
+def test_displayResolution():
+    desktop = qApp.desktop().screenGeometry()
+    width, height = desktop.width(), desktop.height()
+    print("\n\nDisplay Resolution Logged as {}x{}\n\n".format(width, height))
+    assert height > 0 and width > 0
diff --git a/test.py b/test.py
--- a/test.py
+++ b/test.py
@@ -21,9 +21,4 @@
 
 import pyqtgraph as pg
 pg.systemInfo()
-qApp = pg.mkQApp()
-desktop = qApp.desktop().screenGeometry()
-print("\n\nDesktop Resolution: {} x {}\n\n".format(desktop.width(), desktop.height()))
 pytest.main(args)
-    
-    
\ No newline at end of file