I added mylang='test' to the user-config file in pywikibot , then when I run SPARQL queries using pagegenerator:
sparql = "SELECT ?item WHERE { ?item rdfs:label '%s'@en }" % val entities = pagegenerators.WikidataSPARQLPageGenerator(sparql,site=pywikibot.Site())
I found out that the results are from www.wikidata and not test.wikidata
I think this better be fixed so people can develop on test.wikidata without ruing www.wikidata