Conducting drug tests in high schools appears to have only a small effect in reducing substance use, a new study suggests. Researchers at the University of Pennsylvania found the tests had no influence on male students, and only a slight impact on females—but only in some schools.

The Los Angeles Times reports the nationwide study of 943 students found 27 percent said their schools had a drug testing policy. For girls, drug testing only had an effect if they attended schools that had a positive school climate, where the students and adults respect one another and the rules of the school are clear and enforced fairly.

“This study sends a cautionary note to the estimated 20 percent or more of high schools that have joined the drug testing bandwagon,” study co-author Dan Romer said in a news release. “We find little evidence that this approach to minimizing teen drug use is having the deterrent effect its proponents claim.”

The article notes the Department of Education’s Office of Safe and Drug-Free Schools encourages drug testing in schools. The study appears in the Journal of Youth and Adolescence.