import os
import sys
import platform
import multiprocessing

import pytest

import keyring


def subprocess_get():
    keyring.get_password('test_app', 'test_user')


pytestmark = [
    pytest.mark.xfail(
        platform.system() == 'Linux',
        reason="#410: keyring discovery fails intermittently",
    ),
    pytest.mark.xfail(
        os.environ.get('AGENT_OS', '') == 'Windows_NT',
        reason="#436: Multiprocessing fails on Azure Windows",
    ),
]


def test_multiprocess_get():
    proc1 = multiprocessing.Process(target=subprocess_get)
    proc1.start()
    proc1.join()
    assert proc1.exitcode == 0


@pytest.mark.skipif(
    # always skip as it crashes the interpreter
    sys.version_info < (3, 8) and platform.system() == 'Darwin',
    reason="#281: Prior to 3.8, multiprocess invocation fails",
)
def test_multiprocess_get_after_native_get():
    keyring.get_password('test_app', 'test_user')
    test_multiprocess_get()

@@ -1,14 +1,4 @@
-import os%0A
 impo
@@ -331,37 +331,24 @@
     
-os.environ.get('AGENT_OS', ''
+platform.system(
 ) ==
@@ -360,11 +360,8 @@
 dows
-_NT
 ',%0A 
@@ -410,21 +410,30 @@
  on 
-Azure 
 Windows
+ intermittently
 %22,%0A 

Mark the test as xfail, as it's failing on appveyor too. Ref #436.