<not true> At first, tests do not need global variables, there could be instance variables (self.cert and self.newcert) </not true> (read comments)
test_0006_service_show uses global cert and then the cert is used in iteration, what means that cert variable is updated several times without any guarantee which value is the last.
certs_encoded = (base64.b64encode(cert) for cert in res['usercertificate'])
See example bellow:
In [1]: cert = 1 In [2]: def f(): ...: global cert ...: l = [cert for cert in range(4)] ...: print cert ...: In [3]: f() 3 In [4]: cert Out[4]: 3
Now it accidentally works, but any change to test may cause "nice to debug" issues.
This blocks enabling of pylint check global-variable-not-assigned
Please note that pytest creates new instance of class for each testcase, so self.something will not work
master:
ipa-4-4:
Metadata Update from @mbasti: - Issue assigned to mbasti - Issue set to the milestone: FreeIPA 4.4.2
Login to comment on this ticket.